#!/bin/bash
USER=yxc125630

for client in `cat clients` 
do
        ssh $USER@$client 'for pid in `/bin/ps aux | /bin/grep "java -jar" | /bin/grep "VotingClient.jar" | /bin/grep -v "grep" | /bin/awk \{print\ \$\2\}`; do kill -KILL $pid; done &'
done

for server in `cat servers` 
do
        ssh $USER@$server 'for pid in `/bin/ps aux | /bin/grep "java -jar" | /bin/grep "VotingServer.jar" | /bin/grep -v "grep" | /bin/awk \{print\ \$\2\}`; do kill -KILL $pid; done &'
done
